import {setServer} from "@/utils/axios";
import {deviceUrl} from "../../../url";

const request = setServer(deviceUrl);
// 查询设备品牌
export function getBrand(query) {
  return request({
    url: '/device/brand/list',
    method: 'get',
    params:query
  })
}

// 查询设备品牌详情
export function getBrandDetail(id) {
  return request({
    url: '/device/brand/'+id,
    method: 'get',
  })
}

// 删除设备品牌
export function deleteBrand(id) {
  return request({
    url: '/device/brand/'+id,
    method: 'delete',
  })
}

// 新增设备品牌
export function addBrand(query) {
  return request({
    url: '/device/brand/',
    method: 'post',
    data:query
  })
}

// 修改设备品牌
export function updateBrand(query) {
  return request({
    url: '/device/brand/',
    method: 'put',
    data:query
  })
}

// 查询设备品牌下拉
export function getBrandByParentId(query) {
  return request({
    url: '/device/brand/parent-id',
    method: 'get',
    params: query
  })
}

// 获取默认品牌型号
export function getDefaultBrand(query) {
  return request({
    url: '/device/brand/defaults-type',
    method: 'get',
    params: query
  })
}

// 设置默认品牌型号
export function updateDefaultBrand(query) {
  return request({
    url: '/device/brand/defaults',
    method: 'get',
    params: query
  })
}

// 获取型号
export function getTypes(query) {
  return request({
    url: '/device/brand/list-child',
    method: 'get',
    params: query
  })
}
